using System;
using System.Collections.Generic;
using System.Text;

namespace Coriander.Xmpp.Logging.Specialized
{
    /// <summary>
    /// 
    /// </summary>
    public class ConsoleLogger : ILogger
    {
        Boolean enabled = true;

        /// <summary>
        /// Gets or sets the enabled flag
        /// </summary>
        public Boolean Enabled
        {
            get { return enabled; }
            set { enabled = value; }
        }

        #region ILogger Members

        /// <summary>
        /// 
        /// </summary>
        /// <param name="message"></param>
        public void Write(string message)
        {
            Write(message);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="format"></param>
        /// <param name="args"></param>
        public void Write(string format, params object[] args)
        {
            if (Enabled)
            {
                if (args.Length > 0)
                {
                    Console.WriteLine(format, args);
                }
                else
                {
                    Console.WriteLine(format);
                }
            }
        }

        #endregion
    }
}
